home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-10-30 | 2.3 KB | 88 lines | [TEXT/MPS ] |
- // OurMain.h
- // Header for our main program.
- // Contains all our derived classes and our new classes.
- // The TApplication and TDocument folders have been left unchanged.
- // The application is tailored in the classes below.
-
- #define OURMAIN
- #define override virtual
-
- #include ":TApplication:TApplication.h"
-
- // Constants (also see OurMainShared.h).
-
- enum {
- kBWOffset = 1, // B&W ID = Color ID + kBWOffset
- kNoFilterProc = NULL,
- kInFrontOfAll = -1,
- kDefaultStorage = NULL
- };
-
- // ------------------------------------------------------------------------
- // A new art class.
- // The art drawn in the window.
- class TArt : public HandleObject
- {
- private:
- short fPictID; // Art PICT ID.
- Rect fDrawRect; // Rect of object in window.
- protected:
- public:
- virtual void Draw(short depth);
- virtual void GetDrawRect(Rect& theRect);
- virtual void Init(short resID, short drawLocV, short drawLocH);
- };
-
- // ------------------------------------------------------------------------
- // A new window class.
- // Manages everything inside the window.
- class TWin : public HandleObject
- {
- private:
- TArt* fArt1; // Art object
- TArt* fArt2; // Art object
- TArt* fArt3; // Art object
- static pascal void DrawProc(short depth, short deviceFlags,
- GDHandle hTargetDevice,
- long userData);
- protected:
- public:
- TWin(); // Constructor
- virtual ~TWin(); // Destructor
- virtual void Draw();
- };
-
- // ------------------------------------------------------------------------
- // Derive our document class from the document base class.
- // Our derived document class manages the window object.
- // The base class manages the Window Manager window pointer.
-
- class TOurDoc : public TDocument
- {
- private:
- TWin* fWinObj; // The window object.
- protected:
- public:
- TOurDoc(short resID); // Constructor.
- virtual ~TOurDoc(); // Destructor.
- override void DoUpdate();
- };
-
- // ------------------------------------------------------------------------
- // Derive our application class from the application base class.
- // Add the About dialog, initialization, and a menu.
-
- class TOurApp : public TApplication
- {
- private:
- virtual void DoAbout();
- virtual void GetVersion(Str255 versStr);
- protected:
- override void DoMenuCommand(short menuID, short menuItem);
- public:
- virtual void InitOurApp();
- };
-
-
-
-